﻿namespace Softserve.Pottery.Ordering.Domains
{
    using System;
    using System.Runtime.Serialization;
    using System.Data.Services.Common;
    using Softserve.Pottery.Infrastructure;
    using System.Collections.Generic;
    using Softserve.Pottery.Infrastructure.Interfaces;     

    /// <summary>
    /// Contains info about order domain
    /// </summary>
    [DataContract]
    [DataServiceEntity]
    public class Order : IValidatable, IDomain
    {
        public Order() { }

        #region Properties

        [DataMember]
        public int Id
        {
            get { return m_Id; }
            set { m_Id = value; }
        }

        [DataMember]
        public int UserId
        {
            get { return m_UserId; }
            set { m_UserId = value; }
        }

        [DataMember]
        public OrderStatus Status
        {
            get { return m_Status; }
            set { m_Status = value; }
        }

        [DataMember]
        public int Priority
        {
            get { return m_Priority; }
            set { m_Priority = value; }
        }

        [DataMember]
        public DateTime DateCreate
        {
            get { return m_DateCreate; }
            set { m_DateCreate = value; }
        }

        [DataMember]
        public DateTime DataFinished
        {
            get { return m_DateFinished; }
            set { m_DateFinished = value; }
        }

        [DataMember]
        public DeliveryType DeliveryType
        {
            get { return m_DeliveryType; }
            set { m_DeliveryType = value; }
        }

        [DataMember]
        public int DeliveryAddressId
        {
            get { return m_DeliveryAddressId; }
            set { m_DeliveryAddressId = value; }
        }

        [DataMember]
        public List<int> ItemIdCollection
        {
            get { return m_ItemIdCollaction; }
            set { m_ItemIdCollaction = value; }
        }

        [DataMember]
        public List<int> BatchesID
        {
            get { return m_BatchesID; }
            set { m_BatchesID = value; }
        }

        #endregion

        #region Methods

        public bool Validate()
        {
            return true;
        }

        #endregion

        #region Private fields

        private int m_Id = default(int);

        private int m_UserId = default(int);

        private OrderStatus m_Status = OrderStatus.NotChecked;

        private int m_Priority = default(int);

        private DateTime m_DateCreate = default(DateTime);

        private DateTime m_DateFinished = default(DateTime);

        private DeliveryType m_DeliveryType = default(int);

        private int m_DeliveryAddressId = default(int);

        private List<int> m_ItemIdCollaction = new List<int>();

        private List<int> m_BatchesID = new List<int>();

        #endregion
    }
}
